package com.example.controller;

import com.example.dto.base.Result;
import com.example.service.UserService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

/**
 * <p>
 * 用户表 前端控制器
 * </p>
 *
 * @author baomidou
 * @since 2023-02-28
 */
@RestController
@RequestMapping("/user")
@Api(value = "UserController",tags = "用户控制层")
public class UserController {

    @Autowired
    private UserService userService;
    @ApiOperation(value = "登录接口")
    @PostMapping("/login")
    public Result<String> login(@RequestParam("account") String account,@RequestParam("password") String password){
        String token = userService.login(account,password);
        return Result.successData(token);
    }
}
